package form;

import widget.*;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by LLAP on 2017/12/7.
 * Copyright (c) 2017 LLAP. All rights reserved.
 */
public class Test extends Form {

    public Test() {
        super("test");
        this.setSize(400, 400);

        GridBagLayout gbl = new GridBagLayout();
        GridBagConstraints gbs = new GridBagConstraints();
        this.setLayout(gbl);
        JButton b1 = new JButton("1");
        JButton b2 = new JButton("2");

        this.add(b1);
        this.add(b2);
        gbs.fill = GridBagConstraints.BOTH;
        gbs.gridheight = 1;
        gbs.gridwidth = 1;
        gbs.insets = new Insets(5,5,5,5);
        gbs.weightx = 1;
        gbs.weighty = 1;
        gbs.gridx = 0;
        gbs.gridy = 0;
        gbl.setConstraints(b1, gbs);


        gbs.fill = GridBagConstraints.BOTH;
        gbs.gridheight = 1;
        gbs.gridwidth = 1;
        gbs.insets = new Insets(1, 1, 1, 1);
        gbs.weightx = 3;
        gbs.weighty = 1;
        gbs.gridx = 1;
        gbs.gridy = 0;
        gbl.setConstraints(b2, gbs);
        /*gbl.setConstraints(b2, new GridBagConstraints() {{
            fill = GridBagConstraints.BOTH;
            gridheight = 1;
            gridwidth = 3;
            insets = new Insets(1, 1, 1, 1);
            weightx = 1;
            weighty = 1;
            gridx = 1;
            gridy = 0;
        }});*/

    }

    public static void main(String[] args) {
        new Test().setVisible(true);
    }
}

